package com.lxg;

import com.lxg.config.SpringConfig;
import com.lxg.dao.BookDao;
import com.lxg.service.BookService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author 陆小根
 * date: 2022/04/24
 * Description:
 */

public class AppForAnnotation {

  public static void main(String[] args) {
    ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
    BookDao bookDao = context.getBean(BookDao.class);
    System.out.println(bookDao);
    bookDao.save();

    System.out.println("===============");
    BookService bookService = context.getBean(BookService.class);
    System.out.println(bookService);
  }

}
